import { ElMessage } from 'element-plus';
import type { ResErrorData } from '@/common/interfaces.ts';


export const myElMessage = (res_data: ResErrorData, type: string) => {
	let messageText = ``;
	for (const [k, v] of Object.entries(res_data)) {
		messageText += `-->${k}:${v.join(',')}\n`;
	}
	if (messageText.length) {
		ElMessage({
			message: messageText,
			type: type,
		})
	}
}